package my.suveng.oauth2.service.db.mysql.model.entity;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 角色表
 * 
 * @author suveng
 * 
 * @date 2020-03-28 23:57:57
 */
@DynamicUpdate
@DynamicInsert
@Entity
@Data
@Table(name = "sys_role")
public class SysRole implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @GeneratedValue
    @Column(name = "id")
    private Long id;

    /**
     * 权限名称
     */
    @Column(name = "name")
    private String name;

    /**
     * 创建者
     */
    @Column(name = "creator")
    private Long creator;

    /**
     * 更新者
     */
    @Column(name = "updator")
    private Long updator;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 修改时间,更新则修改
     */
    @Column(name = "modify_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date modifyTime;

    /**
     * 状态标记
     */
    @Column(name = "status")
    private Integer status;

}
